import { RouteRecordRaw } from "vue-router";
import Home from "../Layout.vue";
import Login from "../views/Login.vue";
import { NavItem } from "../ts/model/NavItem";

systemsetting: [
  new NavItem(
    1,
    "首页",
    "iconfont icon-shouye",
    "/system/index",
    "system:index:menu",
    []
  ),
  new NavItem(
    2,
    "用户管理",
    "iconfont icon-fenzuguanli",
    "",
    "users:user:folder",
    [
      new NavItem(
        21,
        "权限管理",
        "iconfont icon-yonghuming",
        "/users/permission",
        "users:user:menu",
        []
      ),
      new NavItem(
        22,
        "角色管理",
        "iconfont icon-yonghuming",
        "/users/role",
        "users:role:menu",
        []
      ),
      new NavItem(
        23,
        "用户管理",
        "iconfont icon-yonghuming",
        "/users/user",
        "users:user:menu",
        []
      )
    ]
  ),
  new NavItem(
    3,
    "门店管理",
    "iconfont icon-fenzuguanli",
    "",
    "devices:device:folder",
    [
      new NavItem(
        31,
        "门店管理",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        31,
        "门店组管理",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      )
    ]
  ),
  new NavItem(
    4,
    "茶饮生产管理",
    "iconfont icon-fenzuguanli",
    "",
    "devices:device:folder",
    [
      new NavItem(
        41,
        "配方管理",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        42,
        "配方分类",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        43,
        "规格配置",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        44,
        "物料单位",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        45,
        "物料类型",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        46,
        "物料管理",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        47,
        "物料精度模版",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      )
    ]
  ),
  new NavItem(
    5,
    "食品安全规则",
    "iconfont icon-fenzuguanli",
    "",
    "devices:device:folder",
    [
      new NavItem(
        51,
        "设置营业准备",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        52,
        "设置打烊规则",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        53,
        "设置预警规则",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        54,
        "设置排料规则",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        55,
        "设置物料使用规则",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      ),
      new NavItem(
        56,
        "设置清洗规则",
        "iconfont icon-yingjian",
        "/devices/deviceList",
        "devices:device:menu",
        []
      )
    ]
  ),
  new NavItem(
    6,
    "机台管理",
    "iconfont icon-fenzuguanli",
    "/system/phoneMessage",
    "messages:message:folder",
    [
      new NavItem(
        61,
        "预部署机台",
        "icon-yingjian",
        "/messages/messageList",
        "messages:textmessage:menu",
        []
      ),
      new NavItem(
        62,
        "机台部署模版",
        "icon-yingjian",
        "/messages/voiceList",
        "messages:voicemessage:menu",
        []
      ),
      new NavItem(
        63,
        "机台管理",
        "icon-yingjian",
        "/messages/voiceList",
        "messages:voicemessage:menu",
        []
      ),
      new NavItem(
        64,
        "机台保养设置",
        "icon-yingjian",
        "/messages/voiceList",
        "messages:voicemessage:menu",
        []
      )
    ]
  ),

  new NavItem(
    7,
    "短信管理",
    "iconfont icon-fenzuguanli",
    "/system/phoneMessage",
    "messages:message:folder",
    [
      new NavItem(
        71,
        "短信列表",
        "icon-yingjian",
        "/messages/messageList",
        "messages:textmessage:menu",
        []
      ),
      new NavItem(
        72,
        "语音列表",
        "icon-yingjian",
        "/messages/voiceList",
        "messages:voicemessage:menu",
        []
      )
    ]
  ),

  new NavItem(
    9,
    "系统设置",
    "iconfont icon-fenzuguanli",
    "/system/phoneMessage",
    "systems:system:folder",
    [
      new NavItem(
        91,
        "用户反馈",
        "icon-yingjian",
        "/system/feedback",
        "settings:feedback:menu",
        []
      ),
      new NavItem(
        92,
        "版本管理",
        "icon-yingjian",
        "/system/version",
        "settings:version:menu",
        []
      )
    ]
  )
];

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: Home,
    redirect: "/system/index",
    children: [
      //系统管理模块
      {
        path: "/system/index",
        name: "Index",
        component: () => import("@/views/system-setting/index.vue")
      },
      {
        path: "/system/version",
        name: "Version",
        component: () => import("@/views/system-setting/VersionManage.vue")
      },

      //用户管理模块
      {
        path: "/users/permission",
        name: "Permission",
        component: () => import("@/views/user-center/PermissionManage.vue")
      },
      {
        path: "/users/role",
        name: "Role",
        component: () => import("@/views/user-center/RoleManage.vue")
      },
      {
        path: "/users/user",
        name: "User",
        component: () => import("@/views/user-center/UserManage.vue")
      },

      //设备管理
      {
        path: "/devices/deviceList",
        name: "DeviceList",
        component: () => import("@/views/device-manage/DeviceList.vue")
      },

      //订单管理
      {
        path: "/orders/orderList",
        name: "OrderList",
        component: () => import("@/views/order-manage/OrderList.vue")
      },
      {
        path: "/orders/orderDetailList",
        name: "orderDetailList",
        component: () => import("@/views/order-manage/OrderDetailList.vue")
      },

      //短信管理
      {
        path: "/messages/messageList",
        name: "MessageList",
        component: () => import("@/views/message-manage/MessageList.vue")
      },
      {
        path: "/messages/voiceList",
        name: "VoiceList",
        component: () => import("@/views/message-manage/VoiceMessageList.vue")
      },
      {
        path: "/system/phoneMessage",
        name: "NotFound",
        component: () => import("@/NotFound.vue")
      },

      //用户反馈
      {
        path: "/system/feedback",
        name: "FeedbackManage",
        component: () => import("@/views/system-setting/FeedbackManage.vue")
      },

      //版本管理
      {
        path: "/system/version",
        name: "VersionManage",
        component: () => import("@/views/system-setting/VersionManage.vue")
      }

      //暂无功能
    ]
  },
  {
    path: "/login",
    name: "Login",
    component: Login
  }
];

export { routes };
